package com.wangt.biz.service.impl;

import com.wangt.biz.mqtt.MqttConsumerConfig;
import com.wangt.biz.service.MqttService;
import com.wangt.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class MqttServiceImpl implements MqttService {

    @Autowired
    private MqttConsumerConfig mqttClient;

    @Override
    public R sub(String topic, int ops) {
        mqttClient.subscribe(topic,ops);
        return R.ok();
    }

    @Override
    public List<String> topic() {
        List<String> list = new ArrayList<>();
        list.add("test");
        return list;
    }
}
